﻿using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UITesting.WinControls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CalculatorLittleRobust
{
    class CS362NumberButton
    {
        private readonly int basenumber = 130;
        //private readonly int baseNumberForHex = 145;
        private WinWindow UIItemNumWindow;
        private WinButton UIItemNumButton;
        private string number;


        // currently pass only single digits, 0 to 9
        public CS362NumberButton(string number)
        {
            
            this.number = number;
            UIItemNumWindow = new WinWindow();
            UIItemNumWindow.SearchProperties[WinWindow.PropertyNames.ControlId] = (basenumber + int.Parse(number)).ToString();
            UIItemNumButton = new WinButton(UIItemNumWindow);
            UIItemNumButton.SearchProperties[WinButton.PropertyNames.Name] = number.ToString();

            
        }

        public void Click()
        {
            Mouse.Click(UIItemNumButton);
            
        }
        
    }
}
